Completed
Pull Request — develop (#110)
by Xaver
01:03
created

module.exports   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 28

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
dl 0
loc 28
rs 8.8571
nop 3

1 Function

Rating   Name   Duplication   Size   Complexity  
B 0 26 1
1
module.exports = function (gulp, plugins, config) {
0 ignored issues
show
Unused Code introduced by
The parameter config is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
2
  return function htmlmin() {
3
    const fs = require('fs');
0 ignored issues
show
Unused Code introduced by
The constant fs seems to be never used. Consider removing it.
Loading history...
4
5
    return gulp.src('build/*.html')
6
      .pipe(plugins.inject(gulp.src(['config.json']), {
7
        starttag: '<!-- inject:config -->',
8
        transform: function (filePath, file) {
9
          return '<script>var jsonData =' +
10
            file.contents.toString('utf8')
11
              .replace('<!-- inject:cache-breaker -->',
12
                Math.random().toString(12).substring(7)) +
13
            ';</script>'
14
            ;
15
        }
16
      }))
17
      .pipe(plugins.kyhInlineSource({ compress: false }))
18
      .pipe(plugins.cacheBust({
19
        type: 'timestamp'
20
      }))
21
      .pipe(plugins.htmlmin({
22
        removeComments: true,
23
        collapseWhitespace: true,
24
        minifyJS: true
25
      }))
26
      .pipe(gulp.dest('build'));
27
  };
28
};
29